<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>qLibc: extensions/qhttpclient.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">qLibc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('qhttpclient_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">qhttpclient.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>HTTP client object.  
<a href="#details">More...</a></p>

<p><a href="qhttpclient_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad02ab7af04409020264521a798de2a5a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad02ab7af04409020264521a798de2a5a"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_NO_RESPONSE</b>&#160;&#160;&#160;(0)</td></tr>
<tr class="separator:ad02ab7af04409020264521a798de2a5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1f324698e12fefadfc2ec5d16ce6a5b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad1f324698e12fefadfc2ec5d16ce6a5b"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_CONTINUE</b>&#160;&#160;&#160;(100)</td></tr>
<tr class="separator:ad1f324698e12fefadfc2ec5d16ce6a5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a471de168f41ecf5e8d62a43fea28b5d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a471de168f41ecf5e8d62a43fea28b5d7"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_OK</b>&#160;&#160;&#160;(200)</td></tr>
<tr class="separator:a471de168f41ecf5e8d62a43fea28b5d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00c11c6c6bf42cf1fb483c273454cf45"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a00c11c6c6bf42cf1fb483c273454cf45"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_CREATED</b>&#160;&#160;&#160;(201)</td></tr>
<tr class="separator:a00c11c6c6bf42cf1fb483c273454cf45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e41c8a47383e2bdf4b34ce5510bc9b6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e41c8a47383e2bdf4b34ce5510bc9b6"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_NO_CONTENT</b>&#160;&#160;&#160;(204)</td></tr>
<tr class="separator:a7e41c8a47383e2bdf4b34ce5510bc9b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a463a0b7aed650158725b205bc1bd0de8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a463a0b7aed650158725b205bc1bd0de8"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_MULTI_STATUS</b>&#160;&#160;&#160;(207)</td></tr>
<tr class="separator:a463a0b7aed650158725b205bc1bd0de8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33f32423ccbf3a2a61f56cc5aee18cd8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a33f32423ccbf3a2a61f56cc5aee18cd8"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_MOVED_TEMPORARILY</b>&#160;&#160;&#160;(302)</td></tr>
<tr class="separator:a33f32423ccbf3a2a61f56cc5aee18cd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a225a5999b63c699c4492a8412b315452"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a225a5999b63c699c4492a8412b315452"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_NOT_MODIFIED</b>&#160;&#160;&#160;(304)</td></tr>
<tr class="separator:a225a5999b63c699c4492a8412b315452"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16c7e21f17349c2515fe0134f9b7ffd4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a16c7e21f17349c2515fe0134f9b7ffd4"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_BAD_REQUEST</b>&#160;&#160;&#160;(400)</td></tr>
<tr class="separator:a16c7e21f17349c2515fe0134f9b7ffd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac68e0a1d868dad52967d757dab5220db"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac68e0a1d868dad52967d757dab5220db"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_FORBIDDEN</b>&#160;&#160;&#160;(403)</td></tr>
<tr class="separator:ac68e0a1d868dad52967d757dab5220db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20eb5cc8af538c827de0f7ed9811243c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a20eb5cc8af538c827de0f7ed9811243c"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_NOT_FOUND</b>&#160;&#160;&#160;(404)</td></tr>
<tr class="separator:a20eb5cc8af538c827de0f7ed9811243c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c8d72a7d4eda32ad9a6211958463e97"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c8d72a7d4eda32ad9a6211958463e97"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_METHOD_NOT_ALLOWED</b>&#160;&#160;&#160;(405)</td></tr>
<tr class="separator:a7c8d72a7d4eda32ad9a6211958463e97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78c49465c70c576daa60e34a84a9e47c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a78c49465c70c576daa60e34a84a9e47c"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_REQUEST_TIME_OUT</b>&#160;&#160;&#160;(408)</td></tr>
<tr class="separator:a78c49465c70c576daa60e34a84a9e47c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0023f7e49348c8c52b2fb8b547202ed3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0023f7e49348c8c52b2fb8b547202ed3"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_REQUEST_URI_TOO_LONG</b>&#160;&#160;&#160;(414)</td></tr>
<tr class="separator:a0023f7e49348c8c52b2fb8b547202ed3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d47746cc8b934944ed4f05308b2da63"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6d47746cc8b934944ed4f05308b2da63"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_INTERNAL_SERVER_ERROR</b>&#160;&#160;&#160;(500)</td></tr>
<tr class="separator:a6d47746cc8b934944ed4f05308b2da63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e272d1190eb37ce4447a9021f68a0c4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e272d1190eb37ce4447a9021f68a0c4"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_NOT_IMPLEMENTED</b>&#160;&#160;&#160;(501)</td></tr>
<tr class="separator:a9e272d1190eb37ce4447a9021f68a0c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00a05677bf92a38abf5be28b5ce0d294"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a00a05677bf92a38abf5be28b5ce0d294"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_CODE_SERVICE_UNAVAILABLE</b>&#160;&#160;&#160;(503)</td></tr>
<tr class="separator:a00a05677bf92a38abf5be28b5ce0d294"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba396af03e2875b5ddedee43ad3c4707"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba396af03e2875b5ddedee43ad3c4707"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HTTP_PROTOCOL_11</b>&#160;&#160;&#160;&quot;HTTP/1.1&quot;</td></tr>
<tr class="separator:aba396af03e2875b5ddedee43ad3c4707"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a337b3f9b61cacbcde92a255249e4aae5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a337b3f9b61cacbcde92a255249e4aae5"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SET_TCP_LINGER_TIMEOUT</b>&#160;&#160;&#160;(15)   /*&lt; linger seconds, 0 for disable */</td></tr>
<tr class="separator:a337b3f9b61cacbcde92a255249e4aae5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c266040b26660f0c96255cadd8ee087"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c266040b26660f0c96255cadd8ee087"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SET_TCP_NODELAY</b>&#160;&#160;&#160;(1)    /*&lt; 0 for disable */</td></tr>
<tr class="separator:a8c266040b26660f0c96255cadd8ee087"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34f24b8ca491cffac52bdd24140cd923"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34f24b8ca491cffac52bdd24140cd923"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_SHUTDOWN_WAIT</b>&#160;&#160;&#160;(100)  /*&lt; maximum shutdown wait, unit is ms */</td></tr>
<tr class="separator:a34f24b8ca491cffac52bdd24140cd923"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93983c38a271da5bde55becc02135bdb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a93983c38a271da5bde55becc02135bdb"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_ATOMIC_DATA_SIZE</b>&#160;&#160;&#160;(32 * 1024)  /*&lt; maximum sending bytes */</td></tr>
<tr class="separator:a93983c38a271da5bde55becc02135bdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:acba5e1d5c9b1666945f7b0ca4da0785b"><td class="memItemLeft" align="right" valign="top">qhttpclient_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a> (const char *destname, int port)</td></tr>
<tr class="memdesc:acba5e1d5c9b1666945f7b0ca4da0785b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize &amp; create new HTTP client.  <a href="#acba5e1d5c9b1666945f7b0ca4da0785b">More...</a><br/></td></tr>
<tr class="separator:acba5e1d5c9b1666945f7b0ca4da0785b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c8eb3bb63df37fe248d858715894870"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a5c8eb3bb63df37fe248d858715894870">setssl</a> (qhttpclient_t *client)</td></tr>
<tr class="memdesc:a5c8eb3bb63df37fe248d858715894870"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a5c8eb3bb63df37fe248d858715894870" title="qhttpclient-&gt;setssl(): Sets connection to HTTPS connection ">setssl()</a>: Sets connection to HTTPS connection  <a href="#a5c8eb3bb63df37fe248d858715894870">More...</a><br/></td></tr>
<tr class="separator:a5c8eb3bb63df37fe248d858715894870"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12e0c5c0a30dafae0ece655d6095a75c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a12e0c5c0a30dafae0ece655d6095a75c">settimeout</a> (qhttpclient_t *client, int timeoutms)</td></tr>
<tr class="memdesc:a12e0c5c0a30dafae0ece655d6095a75c"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a12e0c5c0a30dafae0ece655d6095a75c" title="qhttpclient-&gt;settimeout(): Sets connection wait timeout. ">settimeout()</a>: Sets connection wait timeout.  <a href="#a12e0c5c0a30dafae0ece655d6095a75c">More...</a><br/></td></tr>
<tr class="separator:a12e0c5c0a30dafae0ece655d6095a75c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ee9c5a86a3f561a5dcfe201ff20c350"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a7ee9c5a86a3f561a5dcfe201ff20c350">setkeepalive</a> (qhttpclient_t *client, bool keepalive)</td></tr>
<tr class="memdesc:a7ee9c5a86a3f561a5dcfe201ff20c350"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a7ee9c5a86a3f561a5dcfe201ff20c350" title="qhttpclient-&gt;setkeepalive(): Sets KEEP-ALIVE feature on/off. ">setkeepalive()</a>: Sets KEEP-ALIVE feature on/off.  <a href="#a7ee9c5a86a3f561a5dcfe201ff20c350">More...</a><br/></td></tr>
<tr class="separator:a7ee9c5a86a3f561a5dcfe201ff20c350"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6bffb8f3d215b7225da20a6832bf440"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#af6bffb8f3d215b7225da20a6832bf440">setuseragent</a> (qhttpclient_t *client, const char *useragent)</td></tr>
<tr class="memdesc:af6bffb8f3d215b7225da20a6832bf440"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#af6bffb8f3d215b7225da20a6832bf440" title="qhttpclient-&gt;setuseragent(): Sets user-agent string. ">setuseragent()</a>: Sets user-agent string.  <a href="#af6bffb8f3d215b7225da20a6832bf440">More...</a><br/></td></tr>
<tr class="separator:af6bffb8f3d215b7225da20a6832bf440"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaab09f1f3ab6486633b0ea1c0fd65cd2"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#aaab09f1f3ab6486633b0ea1c0fd65cd2">open_</a> (qhttpclient_t *client)</td></tr>
<tr class="memdesc:aaab09f1f3ab6486633b0ea1c0fd65cd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;open(): Opens a connection to the remote host.  <a href="#aaab09f1f3ab6486633b0ea1c0fd65cd2">More...</a><br/></td></tr>
<tr class="separator:aaab09f1f3ab6486633b0ea1c0fd65cd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3c34055be115314ffe7f18c3d19eb54"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#ac3c34055be115314ffe7f18c3d19eb54">head</a> (qhttpclient_t *client, const char *uri, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)</td></tr>
<tr class="memdesc:ac3c34055be115314ffe7f18c3d19eb54"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#ac3c34055be115314ffe7f18c3d19eb54" title="qhttpclient-&gt;head(): Sends a HEAD request. ">head()</a>: Sends a HEAD request.  <a href="#ac3c34055be115314ffe7f18c3d19eb54">More...</a><br/></td></tr>
<tr class="separator:ac3c34055be115314ffe7f18c3d19eb54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af16a3eb0912e8b5d4896466632d9c843"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#af16a3eb0912e8b5d4896466632d9c843">get</a> (qhttpclient_t *client, const char *uri, int fd, off_t *savesize, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders, bool(*callback)(void *userdata, off_t recvbytes), void *userdata)</td></tr>
<tr class="memdesc:af16a3eb0912e8b5d4896466632d9c843"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#af16a3eb0912e8b5d4896466632d9c843" title="qhttpclient-&gt;get(): Downloads a file from the remote host using GET method. ">get()</a>: Downloads a file from the remote host using GET method.  <a href="#af16a3eb0912e8b5d4896466632d9c843">More...</a><br/></td></tr>
<tr class="separator:af16a3eb0912e8b5d4896466632d9c843"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9ac3bd43c11509c0cbd8fb284bf13eb"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#ae9ac3bd43c11509c0cbd8fb284bf13eb">put</a> (qhttpclient_t *client, const char *uri, int fd, off_t length, int *rescode, qlisttbl_t *reqheaders, qlisttbl_t *resheaders, bool(*callback)(void *userdata, off_t sentbytes), void *userdata)</td></tr>
<tr class="memdesc:ae9ac3bd43c11509c0cbd8fb284bf13eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#ae9ac3bd43c11509c0cbd8fb284bf13eb" title="qhttpclient-&gt;put(): Uploads a file to the remote host using PUT method. ">put()</a>: Uploads a file to the remote host using PUT method.  <a href="#ae9ac3bd43c11509c0cbd8fb284bf13eb">More...</a><br/></td></tr>
<tr class="separator:ae9ac3bd43c11509c0cbd8fb284bf13eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af152fd3b6a32a801dc70a03119b13154"><td class="memItemLeft" align="right" valign="top">static void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#af152fd3b6a32a801dc70a03119b13154">cmd</a> (qhttpclient_t *client, const char *method, const char *uri, void *data, size_t size, int *rescode, size_t *contentslength, qlisttbl_t *reqheaders, qlisttbl_t *resheaders)</td></tr>
<tr class="memdesc:af152fd3b6a32a801dc70a03119b13154"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#af152fd3b6a32a801dc70a03119b13154" title="qhttpclient-&gt;cmd(): Sends a custom request(method) to the remote host and reads it&#39;s response...">cmd()</a>: Sends a custom request(method) to the remote host and reads it's response.  <a href="#af152fd3b6a32a801dc70a03119b13154">More...</a><br/></td></tr>
<tr class="separator:af152fd3b6a32a801dc70a03119b13154"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d31e08f7bc114b63cd3140f5f8dc259"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a1d31e08f7bc114b63cd3140f5f8dc259">sendrequest</a> (qhttpclient_t *client, const char *method, const char *uri, qlisttbl_t *reqheaders)</td></tr>
<tr class="memdesc:a1d31e08f7bc114b63cd3140f5f8dc259"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a1d31e08f7bc114b63cd3140f5f8dc259" title="qhttpclient-&gt;sendrequest(): Sends a HTTP request to the remote host. ">sendrequest()</a>: Sends a HTTP request to the remote host.  <a href="#a1d31e08f7bc114b63cd3140f5f8dc259">More...</a><br/></td></tr>
<tr class="separator:a1d31e08f7bc114b63cd3140f5f8dc259"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a865df9ac070a17d0751e1083af770bb1"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a865df9ac070a17d0751e1083af770bb1">readresponse</a> (qhttpclient_t *client, qlisttbl_t *resheaders, off_t *contentlength)</td></tr>
<tr class="memdesc:a865df9ac070a17d0751e1083af770bb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a865df9ac070a17d0751e1083af770bb1" title="qhttpclient-&gt;readresponse(): Reads HTTP response header from the remote host. ">readresponse()</a>: Reads HTTP response header from the remote host.  <a href="#a865df9ac070a17d0751e1083af770bb1">More...</a><br/></td></tr>
<tr class="separator:a865df9ac070a17d0751e1083af770bb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade555b391a0ff83b074eb16a5ba2192f"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#ade555b391a0ff83b074eb16a5ba2192f">gets_</a> (qhttpclient_t *client, char *buf, size_t bufsize)</td></tr>
<tr class="memdesc:ade555b391a0ff83b074eb16a5ba2192f"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;gets(): Reads a text line from a HTTP/HTTPS stream.  <a href="#ade555b391a0ff83b074eb16a5ba2192f">More...</a><br/></td></tr>
<tr class="separator:ade555b391a0ff83b074eb16a5ba2192f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5dd8f813968295a3cfba53c0acaee487"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a5dd8f813968295a3cfba53c0acaee487">read_</a> (qhttpclient_t *client, void *buf, size_t nbytes)</td></tr>
<tr class="memdesc:a5dd8f813968295a3cfba53c0acaee487"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;read(): Reads data from a HTTP/HTTPS stream.  <a href="#a5dd8f813968295a3cfba53c0acaee487">More...</a><br/></td></tr>
<tr class="separator:a5dd8f813968295a3cfba53c0acaee487"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69254acf43767884d060506b96f5c274"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a69254acf43767884d060506b96f5c274">write_</a> (qhttpclient_t *client, const void *buf, size_t nbytes)</td></tr>
<tr class="memdesc:a69254acf43767884d060506b96f5c274"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;write(): Writes data to a HTTP/HTTPS stream.  <a href="#a69254acf43767884d060506b96f5c274">More...</a><br/></td></tr>
<tr class="separator:a69254acf43767884d060506b96f5c274"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2036374892fed2d1eff6eee25dcbfd9b"><td class="memItemLeft" align="right" valign="top">static off_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a2036374892fed2d1eff6eee25dcbfd9b">recvfile</a> (qhttpclient_t *client, int fd, off_t nbytes)</td></tr>
<tr class="memdesc:a2036374892fed2d1eff6eee25dcbfd9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a2036374892fed2d1eff6eee25dcbfd9b" title="qhttpclient-&gt;recvfile(): Reads data from a HTTP/HTTPS stream and save into a file descriptor...">recvfile()</a>: Reads data from a HTTP/HTTPS stream and save into a file descriptor.  <a href="#a2036374892fed2d1eff6eee25dcbfd9b">More...</a><br/></td></tr>
<tr class="separator:a2036374892fed2d1eff6eee25dcbfd9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add20b33d4c87e18756f7023bbc38f22e"><td class="memItemLeft" align="right" valign="top">static off_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#add20b33d4c87e18756f7023bbc38f22e">sendfile_</a> (qhttpclient_t *client, int fd, off_t nbytes)</td></tr>
<tr class="memdesc:add20b33d4c87e18756f7023bbc38f22e"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;sendfile(): Send file data to a HTTP/HTTPS stream.  <a href="#add20b33d4c87e18756f7023bbc38f22e">More...</a><br/></td></tr>
<tr class="separator:add20b33d4c87e18756f7023bbc38f22e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6154b9124c5a57bccfb2dc47c791e555"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a6154b9124c5a57bccfb2dc47c791e555">_close</a> (qhttpclient_t *client)</td></tr>
<tr class="memdesc:a6154b9124c5a57bccfb2dc47c791e555"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;close(): Closes the connection.  <a href="#a6154b9124c5a57bccfb2dc47c791e555">More...</a><br/></td></tr>
<tr class="separator:a6154b9124c5a57bccfb2dc47c791e555"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a0cda760109d998ee40b94b665ef0ca"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qhttpclient_8c.html#a7a0cda760109d998ee40b94b665ef0ca">_free</a> (qhttpclient_t *client)</td></tr>
<tr class="memdesc:a7a0cda760109d998ee40b94b665ef0ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">qhttpclient-&gt;free(): Free object.  <a href="#a7a0cda760109d998ee40b94b665ef0ca">More...</a><br/></td></tr>
<tr class="separator:a7a0cda760109d998ee40b94b665ef0ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>HTTP client object. </p>
<p>qhttpclient implements HTTP client.</p>
<p>Example code for simple HTTP GET operation.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#define REMOTE_URL  &quot;/robots.txt&quot;</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define SAVEFILE    &quot;/tmp/robots.txt&quot;</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>) {</div>
<div class="line">  <span class="comment">// create new HTTP client</span></div>
<div class="line">  qhttpclient_t *httpclient = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;https://secure.qdecoder.org&quot;</span>, 0);</div>
<div class="line">  <span class="keywordflow">if</span>(httpclient == NULL) <span class="keywordflow">return</span> -1;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// open file for writing</span></div>
<div class="line">  <span class="keywordtype">int</span> nFd = open(SAVEFILE, O_CREAT | O_TRUNC | O_WRONLY, 0644);</div>
<div class="line">  <span class="keywordflow">if</span>(nFd &lt; 0) {</div>
<div class="line">    httpclient-&gt;free(httpclient);</div>
<div class="line">    <span class="keywordflow">return</span> -1;</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// container for storing response headers for debugging purpose</span></div>
<div class="line">  qlisttbl_t *resheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// download</span></div>
<div class="line">  off_t nSavesize = 0;</div>
<div class="line">  <span class="keywordtype">int</span> nRescode = 0;</div>
<div class="line">  <span class="keywordtype">bool</span> bRet = httpclient-&gt;get(httpclient, REMOTE_URL, nFd, &amp;nSavesize,</div>
<div class="line">                              &amp;nRescode, NULL, resheaders, NULL, NULL);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// close file</span></div>
<div class="line">  close(nFd);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// print out debugging info</span></div>
<div class="line">  printf(<span class="stringliteral">&quot;%s %d, %d bytes saved\n&quot;</span>, (bRet?<span class="stringliteral">&quot;Success&quot;</span>:<span class="stringliteral">&quot;Failed&quot;</span>), nRescode,</div>
<div class="line">                                     (<span class="keywordtype">int</span>)nSavesize);</div>
<div class="line">  resheaders-&gt;debug(resheaders, stdout);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// de-allocate HTTP client object</span></div>
<div class="line">  httpclient-&gt;free(httpclient);</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">return</span> (bRet ? 0 : -1);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">[Output]</div>
<div class="line">Success 200, 30 bytes saved</div>
<div class="line">Date=Fri, 11 Feb 2011 23:40:50 GMT? (30)</div>
<div class="line">Server=Apache? (7)</div>
<div class="line">Last-Modified=Sun, 15 Mar 2009 11:43:07 GMT? (30)</div>
<div class="line">ETag=&quot;2e5c9d-1e-46526d665c8c0&quot;? (26)</div>
<div class="line">Accept-Ranges=bytes? (6)</div>
<div class="line">Content-Length=30? (3)</div>
<div class="line">Cache-Control=max-age=604800? (15)</div>
<div class="line">Expires=Fri, 18 Feb 2011 23:40:50 GMT? (30)</div>
<div class="line">Connection=close? (6)</div>
<div class="line">Content-Type=text/plain? (11)</div>
</div><!-- fragment --><p>Example code for multiple PUT operation using same keep-alive connection.</p>
<div class="fragment"><div class="line"><span class="comment">// create new HTTP client</span></div>
<div class="line">qhttpclient_t *httpclient = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;www.qdecoder.org&quot;</span>, 80);</div>
<div class="line"><span class="keywordflow">if</span>(httpclient == NULL) <span class="keywordflow">return</span>;</div>
<div class="line"></div>
<div class="line"><span class="comment">// set options</span></div>
<div class="line">httpclient-&gt;setkeepalive(httpclient, <span class="keyword">true</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// make a connection</span></div>
<div class="line"><span class="keywordflow">if</span>(httpclient-&gt;open(httpclient) == <span class="keyword">false</span>) <span class="keywordflow">return</span>;</div>
<div class="line"></div>
<div class="line"><span class="comment">// upload files</span></div>
<div class="line">httpclient-&gt;put(httpclient, ...);</div>
<div class="line">httpclient-&gt;put(httpclient, ...); <span class="comment">// will be done within same connection.</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// close connection - not necessary if we call free() just after this.</span></div>
<div class="line">httpclient-&gt;close(httpclient);</div>
<div class="line"></div>
<div class="line"><span class="comment">// de-allocate HTTP client object</span></div>
<div class="line">httpclient-&gt;free(httpclient);</div>
</div><!-- fragment --> 
<p>Definition in file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="acba5e1d5c9b1666945f7b0ca4da0785b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">qhttpclient_t* qhttpclient </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>destname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize &amp; create new HTTP client. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">destname</td><td>remote address, one of IP address, FQDN domain name and URI. </td></tr>
    <tr><td class="paramname">port</td><td>remote port number. (can be 0 when destname is URI)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>HTTP client object if succcessful, otherwise returns NULL.</dd></dl>
<div class="fragment"><div class="line">qhttpclient_t *client = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;1.2.3.4&quot;</span>, 80);</div>
<div class="line">qhttpclient_t *client = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;www.qdecoder.org&quot;</span>, 80);</div>
<div class="line">qhttpclient_t *client = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;http://www.qdecoder.org&quot;</span>, 0);</div>
<div class="line">qhttpclient_t *client = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;http://www.qdecoder.org:80&quot;</span>, 0);</div>
<div class="line">qhttpclient_t *client = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;https://www.qdecoder.org&quot;</span>, 0);</div>
<div class="line">qhttpclient_t *client = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;https://www.qdecoder.org:443&quot;</span>, 0);</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Keep-alive feature is turned off by default. Turn it on by calling <a class="el" href="qhttpclient_8c.html#a7ee9c5a86a3f561a5dcfe201ff20c350" title="qhttpclient-&gt;setkeepalive(): Sets KEEP-ALIVE feature on/off. ">setkeepalive()</a>. If destname is URI string starting with "https://", <a class="el" href="qhttpclient_8c.html#a5c8eb3bb63df37fe248d858715894870" title="qhttpclient-&gt;setssl(): Sets connection to HTTPS connection ">setssl()</a> will be called internally. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00245">245</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5c8eb3bb63df37fe248d858715894870"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool setssl </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a5c8eb3bb63df37fe248d858715894870" title="qhttpclient-&gt;setssl(): Sets connection to HTTPS connection ">setssl()</a>: Sets connection to HTTPS connection </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line">httpclient-&gt;setssl(httpclient);</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00323">323</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a12e0c5c0a30dafae0ece655d6095a75c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void settimeout </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>timeoutms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a12e0c5c0a30dafae0ece655d6095a75c" title="qhttpclient-&gt;settimeout(): Sets connection wait timeout. ">settimeout()</a>: Sets connection wait timeout. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer </td></tr>
    <tr><td class="paramname">timeoutms</td><td>timeout mili-seconds. 0 for system defaults</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line">httpclient-&gt;settimeout(httpclient, 0);    <span class="comment">// default</span></div>
<div class="line">httpclient-&gt;settimeout(httpclient, 5000); <span class="comment">// 5 seconds</span></div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00363">363</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7ee9c5a86a3f561a5dcfe201ff20c350"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void setkeepalive </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>keepalive</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a7ee9c5a86a3f561a5dcfe201ff20c350" title="qhttpclient-&gt;setkeepalive(): Sets KEEP-ALIVE feature on/off. ">setkeepalive()</a>: Sets KEEP-ALIVE feature on/off. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer </td></tr>
    <tr><td class="paramname">keepalive</td><td>true to set keep-alive on, false to set keep-alive off</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line">httpclient-&gt;setkeepalive(httpclient, <span class="keyword">true</span>);  <span class="comment">// keep-alive on</span></div>
<div class="line">httpclient-&gt;setkeepalive(httpclient, <span class="keyword">false</span>); <span class="comment">// keep-alive off</span></div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00380">380</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="af6bffb8f3d215b7225da20a6832bf440"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void setuseragent </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>useragent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#af6bffb8f3d215b7225da20a6832bf440" title="qhttpclient-&gt;setuseragent(): Sets user-agent string. ">setuseragent()</a>: Sets user-agent string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer </td></tr>
    <tr><td class="paramname">useragent</td><td>user-agent string</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line">httpclient-&gt;setuseragent(httpclient, <span class="stringliteral">&quot;MyAgent/1.0&quot;</span>);</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00394">394</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="aaab09f1f3ab6486633b0ea1c0fd65cd2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool open_ </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;open(): Opens a connection to the remote host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise returns false</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Don't need to open a connection unless you definitely need to do this, because qhttpclient open a connection automatically when it's needed. This function also can be used to veryfy a connection failure with remote host.</dd></dl>
<div class="fragment"><div class="line"><span class="keywordflow">if</span>(httpclient-&gt;open(httpclient) == <span class="keyword">false</span>) <span class="keywordflow">return</span>;</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00417">417</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="ac3c34055be115314ffe7f18c3d19eb54"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool head </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rescode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>reqheaders</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>resheaders</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#ac3c34055be115314ffe7f18c3d19eb54" title="qhttpclient-&gt;head(): Sends a HEAD request. ">head()</a>: Sends a HEAD request. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">uri</td><td>URL encoded remote URI for downloading file. ("/path" or "http://.../path") </td></tr>
    <tr><td class="paramname">rescode</td><td>if not NULL, remote response code will be stored. (can be NULL) </td></tr>
    <tr><td class="paramname">reqheaders</td><td>qlisttbl_t pointer which contains additional user request headers. (can be NULL) </td></tr>
    <tr><td class="paramname">resheaders</td><td>qlisttbl_t pointer for storing response headers. (can be NULL)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful(got 200 response), otherwise returns false</dd></dl>
<div class="fragment"><div class="line">main() {</div>
<div class="line">  <span class="comment">// create new HTTP client</span></div>
<div class="line">  qhttpclient_t *httpclient = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;http://www.qdecoder.org&quot;</span>, 0);</div>
<div class="line">  <span class="keywordflow">if</span>(httpclient == NULL) <span class="keywordflow">return</span>;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// set additional custom headers</span></div>
<div class="line">  qlisttbl_t *reqheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line">  qlisttbl_t *resheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// send HEAD request</span></div>
<div class="line">  <span class="keywordtype">int</span> nRescode = 0;</div>
<div class="line">  <span class="keywordtype">char</span> *pszEncPath = qEncodeUrl(<span class="stringliteral">&quot;/img/qdecoder.png&quot;</span>);</div>
<div class="line">  <span class="keywordtype">bool</span> bRet = httpclient-&gt;head(httpclient, pszEncPath, &amp;nRescode,</div>
<div class="line">                              reqheaders, resheaders);</div>
<div class="line">  free(pszEncPath);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// to print out request, response headers</span></div>
<div class="line">  reqheaders-&gt;debug(reqheaders, stdout);</div>
<div class="line">  resheaders-&gt;debug(resheaders, stdout);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// check results</span></div>
<div class="line">  <span class="keywordflow">if</span>(bRet == <span class="keyword">false</span>) {</div>
<div class="line">    ...(error occured)...</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// free resources</span></div>
<div class="line">  httpclient-&gt;free(httpclient);</div>
<div class="line">  reqheaders-&gt;free(reqheaders);</div>
<div class="line">  resheaders-&gt;free(resheaders);</div>
<div class="line">}</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00553">553</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="af16a3eb0912e8b5d4896466632d9c843"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool get </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t *&#160;</td>
          <td class="paramname"><em>savesize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rescode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>reqheaders</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>resheaders</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool(*)(void *userdata, off_t recvbytes)&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userdata</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#af16a3eb0912e8b5d4896466632d9c843" title="qhttpclient-&gt;get(): Downloads a file from the remote host using GET method. ">get()</a>: Downloads a file from the remote host using GET method. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">uri</td><td>URL encoded remote URI for downloading file. ("/path" or "http://.../path") </td></tr>
    <tr><td class="paramname">fd</td><td>opened file descriptor for writing. </td></tr>
    <tr><td class="paramname">savesize</td><td>if not NULL, the length of stored bytes will be stored. (can be NULL) </td></tr>
    <tr><td class="paramname">rescode</td><td>if not NULL, remote response code will be stored. (can be NULL) </td></tr>
    <tr><td class="paramname">reqheaders</td><td>qlisttbl_t pointer which contains additional user request headers. (can be NULL) </td></tr>
    <tr><td class="paramname">resheaders</td><td>qlisttbl_t pointer for storing response headers. (can be NULL) </td></tr>
    <tr><td class="paramname">callback</td><td>set user call-back function. (can be NULL) </td></tr>
    <tr><td class="paramname">userdata</td><td>set user data for call-back. (can be NULL)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful(200 OK), otherwise returns false</dd></dl>
<div class="fragment"><div class="line"><span class="keyword">struct </span>userdata {</div>
<div class="line">  ...</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> callback(<span class="keywordtype">void</span> *userdata, off_t sentbytes) {</div>
<div class="line">  <span class="keyword">struct </span>userdata *pMydata = (<span class="keyword">struct </span>userdata*)userdata;</div>
<div class="line">  ...(codes)...</div>
<div class="line">  <span class="keywordflow">if</span>(need_to_cancel) <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// stop file uploading immediately</span></div>
<div class="line">  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">main() {</div>
<div class="line">  <span class="comment">// create new HTTP client</span></div>
<div class="line">  qhttpclient_t *httpclient = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;http://www.qdecoder.org&quot;</span>, 0);</div>
<div class="line">  <span class="keywordflow">if</span>(httpclient == NULL) <span class="keywordflow">return</span>;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// open file</span></div>
<div class="line">  <span class="keywordtype">int</span> nFd = open(<span class="stringliteral">&quot;/tmp/test.data&quot;</span>, O_WRONLY | O_CREAT, 0644);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// set additional custom headers</span></div>
<div class="line">  qlisttbl_t *reqheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line">  qlisttbl_t *resheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// set userdata</span></div>
<div class="line">  <span class="keyword">struct </span>userdata mydata;</div>
<div class="line">  ...(codes)...</div>
<div class="line"></div>
<div class="line">  <span class="comment">// send file</span></div>
<div class="line">  <span class="keywordtype">int</span> nRescode = 0;</div>
<div class="line">  off_t nSavesize = 0;</div>
<div class="line">  <span class="keywordtype">char</span> *pszEncPath = qEncodeUrl(<span class="stringliteral">&quot;/img/qdecoder.png&quot;</span>);</div>
<div class="line">  <span class="keywordtype">bool</span> bRet = httpclient-&gt;get(httpclient, pszEncPath, nFd, &amp;nSavesize,</div>
<div class="line">                              &amp;nRescode,</div>
<div class="line">                              reqheaders, resheaders,</div>
<div class="line">                              callback, (<span class="keywordtype">void</span>*)&amp;mydata);</div>
<div class="line">  free(pszEncPath);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// to print out request, response headers</span></div>
<div class="line">  reqheaders-&gt;debug(reqheaders, stdout);</div>
<div class="line">  resheaders-&gt;debug(resheaders, stdout);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// check results</span></div>
<div class="line">  <span class="keywordflow">if</span>(bRet == <span class="keyword">false</span>) {</div>
<div class="line">    ...(error occured)...</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// free resources</span></div>
<div class="line">  httpclient-&gt;free(httpclient);</div>
<div class="line">  reqheaders-&gt;free(reqheaders);</div>
<div class="line">  resheaders-&gt;free(resheaders);</div>
<div class="line">  close(nFd);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>The call-back function will be called peridically whenever it send data as much as MAX_ATOMIC_DATA_SIZE. To stop uploading, return false in the call-back function, then PUT process will be stopped immediately. If a connection was not opened, it will open a connection automatically.</dd>
<dd>
The "rescode" will be set if it received any response code from a remote server even though it returns false. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00689">689</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="ae9ac3bd43c11509c0cbd8fb284bf13eb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool put </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rescode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>reqheaders</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>resheaders</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool(*)(void *userdata, off_t sentbytes)&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userdata</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#ae9ac3bd43c11509c0cbd8fb284bf13eb" title="qhttpclient-&gt;put(): Uploads a file to the remote host using PUT method. ">put()</a>: Uploads a file to the remote host using PUT method. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">uri</td><td>remote URL for uploading file. ("/path" or "http://.../path") </td></tr>
    <tr><td class="paramname">fd</td><td>opened file descriptor for reading. </td></tr>
    <tr><td class="paramname">length</td><td>send size. </td></tr>
    <tr><td class="paramname">rescode</td><td>if not NULL, remote response code will be stored. (can be NULL) </td></tr>
    <tr><td class="paramname">reqheaders</td><td>qlisttbl_t pointer which contains additional user request headers. (can be NULL) </td></tr>
    <tr><td class="paramname">resheaders</td><td>qlisttbl_t pointer for storing response headers. (can be NULL) </td></tr>
    <tr><td class="paramname">callback</td><td>set user call-back function. (can be NULL) </td></tr>
    <tr><td class="paramname">userdata</td><td>set user data for call-back. (can be NULL)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful(201 Created), otherwise returns false</dd></dl>
<div class="fragment"><div class="line"><span class="keyword">struct </span>userdata {</div>
<div class="line">  ...</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> callback(<span class="keywordtype">void</span> *userdata, off_t sentbytes) {</div>
<div class="line">  <span class="keyword">struct </span>userdata *pMydata = (<span class="keyword">struct </span>userdata*)userdata;</div>
<div class="line">  ...(codes)...</div>
<div class="line">  <span class="keywordflow">if</span>(need_to_cancel) <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// stop file uploading immediately</span></div>
<div class="line">  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">main() {</div>
<div class="line">  <span class="comment">// create new HTTP client</span></div>
<div class="line">  qhttpclient_t *httpclient = <a class="code" href="qhttpclient_8c.html#acba5e1d5c9b1666945f7b0ca4da0785b">qhttpclient</a>(<span class="stringliteral">&quot;http://www.qdecoder.org&quot;</span>, 0);</div>
<div class="line">  <span class="keywordflow">if</span>(httpclient == NULL) <span class="keywordflow">return</span>;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// open file</span></div>
<div class="line">  <span class="keywordtype">int</span> nFd = open(...);</div>
<div class="line">  off_t nFileSize = ...;</div>
<div class="line">  <span class="keywordtype">char</span> *pFileMd5sum = ...;</div>
<div class="line">  time_t nFileDate = ...;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// set additional custom headers</span></div>
<div class="line">  qlisttbl_t *reqheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line">  reqheaders-&gt;putstr(reqheaders, <span class="stringliteral">&quot;X-FILE-MD5SUM&quot;</span>, pFileMd5sum);</div>
<div class="line">  reqheaders-&gt;putInt(reqheaders, <span class="stringliteral">&quot;X-FILE-DATE&quot;</span>, nFileDate);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// set userdata</span></div>
<div class="line">  <span class="keyword">struct </span>userdata mydata;</div>
<div class="line">  ...(codes)...</div>
<div class="line"></div>
<div class="line">  <span class="comment">// send file</span></div>
<div class="line">  <span class="keywordtype">int</span> nRescode = 0;</div>
<div class="line">  qlisttbl_t *resheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line">  <span class="keywordtype">bool</span> bRet = httpclient-&gt;put(httpclient,</div>
<div class="line">                              <span class="stringliteral">&quot;/img/qdecoder.png&quot;</span>, nFd, nFileSize,</div>
<div class="line">                              &amp;nRescode,</div>
<div class="line">                              reqheaders, resheaders,</div>
<div class="line">                              callback, (<span class="keywordtype">void</span>*)&amp;mydata);</div>
<div class="line">  <span class="comment">// to print out request, response headers</span></div>
<div class="line">  reqheaders-&gt;debug(reqheaders, stdout);</div>
<div class="line">  resheaders-&gt;debug(resheaders, stdout);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// check results</span></div>
<div class="line">  <span class="keywordflow">if</span>(bRet == <span class="keyword">false</span>) {</div>
<div class="line">    ...(error occured)...</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// free resources</span></div>
<div class="line">  httpclient-&gt;free(httpclient);</div>
<div class="line">  reqheaders-&gt;free(reqheaders);</div>
<div class="line">  resheaders-&gt;free(resheaders);</div>
<div class="line">  close(nFd);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>The call-back function will be called peridically whenever it send data as much as MAX_ATOMIC_DATA_SIZE. To stop uploading, return false in the call-back function, then PUT process will be stopped immediately. If a connection was not opened, it will open a connection automatically.</dd>
<dd>
The "rescode" will be set if it received any response code from a remote server even though it returns false. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l00918">918</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="af152fd3b6a32a801dc70a03119b13154"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void* cmd </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rescode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>contentslength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>reqheaders</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>resheaders</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#af152fd3b6a32a801dc70a03119b13154" title="qhttpclient-&gt;cmd(): Sends a custom request(method) to the remote host and reads it&#39;s response...">cmd()</a>: Sends a custom request(method) to the remote host and reads it's response. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">method</td><td>method name. </td></tr>
    <tr><td class="paramname">uri</td><td>remote URL for uploading file. ("/path" or "http://.../path") </td></tr>
    <tr><td class="paramname">data</td><td>data to send. (can be NULL) </td></tr>
    <tr><td class="paramname">size</td><td>data size. </td></tr>
    <tr><td class="paramname">rescode</td><td>if not NULL, remote response code will be stored. (can be NULL) </td></tr>
    <tr><td class="paramname">contentslength</td><td>if not NULL, the contents length will be stored. (can be NULL) </td></tr>
    <tr><td class="paramname">reqheaders</td><td>qlisttbl_t pointer which contains additional user request headers. (can be NULL) </td></tr>
    <tr><td class="paramname">resheaders</td><td>qlisttbl_t pointer for storing response headers. (can be NULL)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>malloced content data if successful, otherwise returns NULL</dd></dl>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> nResCode;</div>
<div class="line"><span class="keywordtype">size_t</span> nContentsLength;</div>
<div class="line"><span class="keywordtype">void</span> *contents = httpclient-&gt;cmd(httpclient, <span class="stringliteral">&quot;DELETE&quot;</span> <span class="stringliteral">&quot;/img/qdecoder.png&quot;</span>,</div>
<div class="line">                                 NULL, 0</div>
<div class="line">                                 &amp;nRescode, &amp;nContentsLength</div>
<div class="line">                                 NULL, NULL);</div>
<div class="line"><span class="keywordflow">if</span>(contents == NULL) {</div>
<div class="line">  ...(error occured)...</div>
<div class="line">} <span class="keywordflow">else</span> {</div>
<div class="line">  printf(<span class="stringliteral">&quot;Response code : %d\n&quot;</span>, nResCode);</div>
<div class="line">  printf(<span class="stringliteral">&quot;Contents length : %zu\n&quot;</span>, nContentsLength);</div>
<div class="line">  printf(<span class="stringliteral">&quot;Contents : %s\n&quot;</span>, (<span class="keywordtype">char</span>*)contents);  <span class="comment">// if contents is printable</span></div>
<div class="line">  free(contents);  <span class="comment">// de-allocate</span></div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>This store server's response into memory so if you expect server responses large amount of data, consider to use <a class="el" href="qhttpclient_8c.html#a1d31e08f7bc114b63cd3140f5f8dc259" title="qhttpclient-&gt;sendrequest(): Sends a HTTP request to the remote host. ">sendrequest()</a> and <a class="el" href="qhttpclient_8c.html#a865df9ac070a17d0751e1083af770bb1" title="qhttpclient-&gt;readresponse(): Reads HTTP response header from the remote host. ">readresponse()</a> instead of using this. The returning malloced content will be allocated +1 byte than actual content size 'contentslength' and will be null terminated. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01091">1091</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a1d31e08f7bc114b63cd3140f5f8dc259"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool sendrequest </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>reqheaders</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a1d31e08f7bc114b63cd3140f5f8dc259" title="qhttpclient-&gt;sendrequest(): Sends a HTTP request to the remote host. ">sendrequest()</a>: Sends a HTTP request to the remote host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer </td></tr>
    <tr><td class="paramname">method</td><td>HTTP method name </td></tr>
    <tr><td class="paramname">uri</td><td>URI string for the method. ("/path" or "http://.../path") </td></tr>
    <tr><td class="paramname">reqheaders</td><td>qlisttbl_t pointer which contains additional user request headers. (can be NULL)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise returns false</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Default headers(Host, User-Agent, Connection) will be used if reqheaders does not have those headers in it.</dd></dl>
<div class="fragment"><div class="line">qlisttbl_t *reqheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line">reqheaders-&gt;putstr(reqheaders,  <span class="stringliteral">&quot;Date&quot;</span>, qTimeGetGmtStaticStr(0), <span class="keyword">true</span>);</div>
<div class="line"></div>
<div class="line">httpclient-&gt;sendrequest(client,</div>
<div class="line">                        <span class="stringliteral">&quot;DELETE&quot;</span>, <span class="stringliteral">&quot;/img/qdecoder.png&quot;</span>, reqheaders);</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01186">1186</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a865df9ac070a17d0751e1083af770bb1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int readresponse </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">qlisttbl_t *&#160;</td>
          <td class="paramname"><em>resheaders</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t *&#160;</td>
          <td class="paramname"><em>contentlength</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a865df9ac070a17d0751e1083af770bb1" title="qhttpclient-&gt;readresponse(): Reads HTTP response header from the remote host. ">readresponse()</a>: Reads HTTP response header from the remote host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer </td></tr>
    <tr><td class="paramname">resheaders</td><td>qlisttbl_t pointer for storing response headers. (can be NULL) </td></tr>
    <tr><td class="paramname">contentlength</td><td>length of content body(or -1 for chunked transfer encoding) will be stored. (can be NULL)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>numeric HTTP response code if successful, otherwise returns 0.</dd></dl>
<div class="fragment"><div class="line"><span class="comment">// send request</span></div>
<div class="line">httpclient-&gt;sendrequest(client, <span class="stringliteral">&quot;DELETE&quot;</span>, <span class="stringliteral">&quot;/img/qdecoder.png&quot;</span>, NULL);</div>
<div class="line"></div>
<div class="line"><span class="comment">// read response</span></div>
<div class="line">qlisttbl_t *resheaders = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_UNIQUE | QLISTTBL_CASEINSENSITIVE);</div>
<div class="line">off_t clength;</div>
<div class="line"><span class="keywordtype">int</span> rescode = httpclient-&gt;readresponse(client, resheaders, &amp;clength);</div>
<div class="line"><span class="keywordflow">if</span>(clength &gt; 0) {</div>
<div class="line">  <span class="comment">// read &amp; throw out a content. don&#39;t need content</span></div>
<div class="line">  httpclient-&gt;read(client, NULL, clength);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Data of content body must be read by a application side, if you want to use Keep-Alive session. Please refer qhttpclient-&gt;read(). </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01285">1285</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="ade555b391a0ff83b074eb16a5ba2192f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t gets_ </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bufsize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;gets(): Reads a text line from a HTTP/HTTPS stream. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer </td></tr>
    <tr><td class="paramname">buf</td><td>data buffer pointer </td></tr>
    <tr><td class="paramname">bufsize</td><td>buffer size</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes read from file descriptor if successful, otherwise returns -1.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Be sure the return value does not mean the length of actual stored data. It means how many bytes are read from the file descriptor, so the new-line characters will be counted, but not stored. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01364">1364</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5dd8f813968295a3cfba53c0acaee487"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t read_ </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;read(): Reads data from a HTTP/HTTPS stream. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">buf</td><td>a buffer pointer for storing content. (can be NULL, then read &amp; throw out content) </td></tr>
    <tr><td class="paramname">length</td><td>content size to read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of bytes readed</dd></dl>
<div class="fragment"><div class="line">off_t clength = 0;</div>
<div class="line"><span class="keywordtype">int</span> resno = client-&gt;readresponse(client, NULL, &amp;clength);</div>
<div class="line"><span class="keywordflow">if</span>(clength &gt; 0) {</div>
<div class="line">  <span class="keywordtype">void</span> *buf = malloc(clength);</div>
<div class="line">  client-&gt;read(client, buf, clength);</div>
<div class="line">}</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01428">1428</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a69254acf43767884d060506b96f5c274"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t write_ </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;write(): Writes data to a HTTP/HTTPS stream. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">buf</td><td>a data pointer. </td></tr>
    <tr><td class="paramname">length</td><td>content size to write.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of bytes written. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01482">1482</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a2036374892fed2d1eff6eee25dcbfd9b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static off_t recvfile </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;<a class="el" href="qhttpclient_8c.html#a2036374892fed2d1eff6eee25dcbfd9b" title="qhttpclient-&gt;recvfile(): Reads data from a HTTP/HTTPS stream and save into a file descriptor...">recvfile()</a>: Reads data from a HTTP/HTTPS stream and save into a file descriptor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">fd</td><td>output file descriptor </td></tr>
    <tr><td class="paramname">nbytes</td><td>the number of bytes to read and save.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes written if successful, otherwise returns -1. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01526">1526</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="add20b33d4c87e18756f7023bbc38f22e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static off_t sendfile_ </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;sendfile(): Send file data to a HTTP/HTTPS stream. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>qhttpclient object pointer. </td></tr>
    <tr><td class="paramname">fd</td><td>input file descriptor </td></tr>
    <tr><td class="paramname">nbytes</td><td>the number of bytes to read and send.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes sent if successful, otherwise returns -1. </dd></dl>

<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01572">1572</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a6154b9124c5a57bccfb2dc47c791e555"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool _close </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;close(): Closes the connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qhttpclient_t</td><td>HTTP object pointer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise returns false</dd></dl>
<div class="fragment"><div class="line">httpclient-&gt;close(httpclient);</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01620">1620</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7a0cda760109d998ee40b94b665ef0ca"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void _free </td>
          <td>(</td>
          <td class="paramtype">qhttpclient_t *&#160;</td>
          <td class="paramname"><em>client</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>qhttpclient-&gt;free(): Free object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qhttpclient_t</td><td>HTTP object pointer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>If the connection was not closed, it will close the connection first prior to de-allocate object.</dd></dl>
<div class="fragment"><div class="line">httpclient-&gt;free(httpclient);</div>
</div><!-- fragment --> 
<p>Definition at line <a class="el" href="qhttpclient_8c_source.html#l01670">1670</a> of file <a class="el" href="qhttpclient_8c_source.html">qhttpclient.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_40c73bf2095fd0473b1b85ccdcac2768.html">extensions</a></li><li class="navelem"><a class="el" href="qhttpclient_8c.html">qhttpclient.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
